
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/jsp/commons/taglibs.jsp"%>

<div class="main_left">
	<!-- <ul class="main_navlist">
		<li class="curr"><a href="#" class="list_icon leimu1">总经理</a></li>
		<li><a href="#" class="list_icon leimu2">调度中心</a></li>
		<li><a href="#" class="list_icon leimu3">业务中心</a></li>
		<li><a href="#" class="list_icon leimu4">项目中心</a></li>
		<li><a href="#" class="list_icon leimu5">设计中心</a></li>
		<li><a href="#" class="list_icon leimu6">管理中心</a></li>
		<li><a href="#" class="list_icon leimu1">日志查询</a></li>
		<li><a href="${ctx}/syspara/sysparaAction!initSyspara.do" class="list_icon leimu2">配置管理</a></li>
	</ul> -->

	<ul id="leftMenu" class="ztree"></ul>


</div>
<link rel="stylesheet" href="${ctx }/jsp/commons/css/ztree/demo.css"
	type="text/css">
<link rel="stylesheet"
	href="${ctx }/jsp/commons/css/ztree/zTreeStyle/zTreeStyle.css"
	type="text/css">

<script type="text/javascript"
	src="${ctx }/jsp/commons/js/ztree/jquery.ztree.exedit-3.5.js"></script>
<SCRIPT type="text/javascript">
<!--
	var curMenu = null, zTree_Menu = null;
	var setting = {
		view : {
			showLine : true,
			selectedMulti : false,
			dblClickExpand : false
		},
		data : {
			simpleData : {
				enable : true
			}
		},
		callback : {
			onNodeCreated : this.onNodeCreated,
			beforeClick : this.beforeClick,
			onClick : this.onClick
		}
	};

	var zNodes = [ {
		id : 1,
		pId : 0,
		name : "总经理",
		open : true
	}, {
		id : 2,
		pId : 0,
		name : "调度中心",
		url : "${ctx}/dispatch/dispatchAction!listInit.action",
		target : "_self"
	}, {
		id : 3,
		pId : 0,
		name : "业务中心"
	}, {
		id : 31,
		pId : 3,
		name : "业务部"
	}, {
		id : 311,
		pId : 31,
		name : "业务信息"
	}, {
		id : 312,
		pId : 31,
		name : "业务订单"
	}, {
		id : 32,
		pId : 3,
		name : "商务部"
	}, {
		id : 321,
		pId : 32,
		name : "商务信息"
	}, {
		id : 322,
		pId : 32,
		name : "商务订单"
	}, {
		id : 323,
		pId : 32,
		name : "商务报价"
	}, {
		id : 4,
		pId : 0,
		name : "项目中心"
	}, {
		id : 41,
		pId : 4,
		name : "项目部"
	}, {
		id : 42,
		pId : 4,
		name : "技术部"
	}, {
		id : 43,
		pId : 4,
		name : "售后部",
		url : "${ctx}/dispatch/dispatchAction!customerListInit.action",
		target : "_self"
	}, {
		id : 5,
		pId : 0,
		name : "设计中心"
	}, {
		id : 6,
		pId : 0,
		name : "管理中心"
	}, {
		id : 61,
		pId : 6,
		name : "人事部"
	}, {
		id : 62,
		pId : 6,
		name : "仓库"
	}, {
		id : 63,
		pId : 6,
		name : "采购"
	}, {
		id : 64,
		pId : 6,
		name : "财务"
	}, {
		id : 7,
		pId : 0,
		name : "日志查询"
	}, {
		id : 8,
		pId : 0,
		name : "配置管理"
	}, {
		id : 81,
		pId : 8,
		name : "客户信息"
	}, {
		id : 82,
		pId : 8,
		name : "供货商配置"
	}, {
		id : 83,
		pId : 8,
		name : "用户管理",
		url : "${ctx}/user/userAction!initUser.action",
		target : "_self"
	}, {
		id : 84,
		pId : 8,
		name : "字典配置",
		url : "${ctx}/syspara/sysparaAction!initSyspara.action",
		target : "_self"

	}, {
		id : 84,
		pId : 8,
		name : "角色管理"
	} ];

	function beforeClick(treeId, node) {
		if (node.isParent) {
			if (node.level === 0) {
				var pNode = curMenu;
				while (pNode && pNode.level !== 0) {
					pNode = pNode.getParentNode();
				}
				if (pNode !== node && pNode !== null) {
					var a = $("#" + pNode.tId + "_a");
					a.removeClass("cur");
					zTree_Menu.expandNode(pNode, false);
				}
				a = $("#" + node.tId + "_a");
				a.addClass("cur");

				var isOpen = false;
				for ( var i = 0, l = node.children.length; i < l; i++) {
					if (node.children[i].open) {
						isOpen = true;
						break;
					}
				}
				if (isOpen) {
					zTree_Menu.expandNode(node, true);
					curMenu = node;
				} else {
					zTree_Menu
							.expandNode(
									node.children[0].isParent ? node.children[0]
											: node, true);
					curMenu = node.children[0];
				}
			} else {
				zTree_Menu.expandNode(node);
			}
		}
		return !node.isParent;
	}
	function onClick(e, treeId, node) {

	}

	$(document)
			.ready(
					function() {
						$.fn.zTree.init($("#leftMenu"), setting, zNodes);
<%--zTree_Menu = $.fn.zTree.getZTreeObj("leftMenu");
		curMenu = zTree_Menu.getNodes()[0].children[0].children[0];
		zTree_Menu.selectNode(curMenu);
		var a = $("#" + zTree_Menu.getNodes()[0].tId + "_a");
		a.addClass("cur");--%>
	});
//-->
</SCRIPT>

